﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Cadastro do Personagem
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <link rel="Stylesheet" type="text/css" href="../../Content/edit.css" />
    <h2>
        Cadastro do Personagem</h2>
    <% using (Html.BeginForm("Edit", "Actors", FormMethod.Post, new { enctype = "multipart/form-data" }))
       { %>
        <%: Html.ValidationSummary() %>
        <table>
            <tr>
                <td>
                    <input type="submit" value="Gravar" />
                    <input type="button" value="Voltar" onclick="document.location.href='<%: Url.Action("Index", "Actors") %>'" />
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td class="label">
                    Nome do Personagem:
                </td>
                <td>
                    <%: Html.TextBox("Name")%>
                </td>
                <td class="label" style="text-align: center;">
                    Imagem atual
                </td>
            </tr>
            <tr valign="top">
                <td class="label">
                    Descrição:
                </td>
                <td>
                    <%: Html.TextArea("Description")%>
                    <br />
                    <table>
                        <tr>
                            <td>
                                Ativo
                            </td>
                            <td>
                                <%: Html.CheckBox("Enabled")%>
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    <img src="<%= Model != null && !string.IsNullOrEmpty(Model.Image) ? Model.Image : "../../images/not_found.jpg" %>" alt="" />
                    <br />
                    <div align="center">
                        <input type="file" name="ImageUploaded" title="Busca a foto do personagem" value="Buscar foto" />
                    </div>
                </td>
            </tr>
        </table>
    <%} %>
</asp:Content>
